package com.wzvtc.vsl.securitytool.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.telephony.TelephonyManager;
import android.widget.Toast;

/**
 * Created by Vsl on 2015/3/25.
 */
public class BootCompleteReceiver extends BroadcastReceiver {
    private SharedPreferences sp;
    private TelephonyManager tm;

    @Override
    public void onReceive(Context context, Intent intent) {
        sp = context.getSharedPreferences("config", Context.MODE_PRIVATE);
        tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

        String saveSim = sp.getString("sim", null);
        String realSim = tm.getSimSerialNumber();
        if (saveSim == null) {

        }
        if (saveSim.equals(realSim)) {

        } else {
            Toast.makeText(context, "sim已经更改", Toast.LENGTH_SHORT).show();
        }
    }
}
